//
//  KPBaseNavigationViewController.swift
//  KPBaseProject
//
//  Created by Kipp Dev on 2018/3/21.
//  Copyright © 2018年 Kipp. All rights reserved.
//

import UIKit
import RTRootNavigationController
import RxSwift
import RxCocoa

class KPBaseNavigationViewController: RTRootNavigationController,UINavigationBarDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()
        navigationBar.shadowImage = UIImage()
    }

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return topViewController!.preferredStatusBarStyle
    }

    override var childViewControllerForStatusBarStyle: UIViewController? {
        return self.topViewController
    }

    override func setNeedsStatusBarAppearanceUpdate() {
        super.setNeedsStatusBarAppearanceUpdate()
    }
    override func pushViewController(_ viewController: UIViewController, animated: Bool) {
        if childViewControllers.count == 1 {
            viewController.hidesBottomBarWhenPushed = true
        }
        super.pushViewController(viewController, animated: animated)
    }

}


